package com.yang.studentsapp.utils;

import android.content.Context;

import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;

/**
 * Created by LongWH on 2016/9/23.
 * All Rights Reserved by ZhiYou @2016 - 2017
 */
public class RQManager {
    private static RequestQueue mQueue;

    private RQManager() {

    }

    /**初始化操作
     * @param context :
     */
    public static void init(Context context) {
        //防止多次初始化
        if (mQueue != null) {
            return;
        }
        mQueue = Volley.newRequestQueue(context);
    }

    private static class SingletonHolder{
        private static RQManager mManager = new RQManager();
    }

    public static RQManager getInstance() {
        return SingletonHolder.mManager;
    }

    public static RequestQueue queue() {
        return mQueue;
    }

}
